﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Kooboo.CMS.SiteConverter.Models
{
    [DataContract(Name = "Layout", Namespace = "http://schemas.datacontract.org/2004/07/Kooboo.CMS.Sites.Models")]
    public class CmsLayout : Kooboo.CMS.Sites.Models.Layout
    {
        private string _body;
        public override string Body
        {
            get
            {
                return _body;
            }
            set
            {
                _body = value;
            }
        }

        private string _fileExtension;
        [DataMember(Order = 1)]
        public override string FileExtension
        {
            get
            {
                if (string.IsNullOrEmpty(_fileExtension))
                {
                    switch (this.EngineName)
                    {
                        case "NVelocity": _fileExtension = ".vm"; break;
                        case "Razor": _fileExtension = ".cshtml"; break;
                        case "WebForm": _fileExtension = ".aspx"; break;
                        default: break;
                    }
                }
                return _fileExtension;
            }
            set
            {
                _fileExtension = value;
            }
        }
    }
}
